#! usr/bin/python #coding=utf-8

from ris_tag.calculate.config import get_tag_conf

tag_conf = None
def setup_conf(conf):
    global tag_conf
    tag_conf = conf

def zhimas_score_tag(s):
    tags = []
    config = get_tag_conf()
    zhimas_score_bad = config.getfloat("芝麻信用分", 'zhimas_score_bad')
    zhimas_score_medium = config.getfloat("芝麻信用分", 'zhimas_score_medium')
    zhimas_score_good = config.getfloat("芝麻信用分", 'zhimas_score_good')
    zhimas_score_very_good = config.getfloat("芝麻信用分", 'zhimas_score_very_good')
    if s < zhimas_score_bad:
        tags.append("芝麻信用分较差")
    elif zhimas_score_bad <= s < zhimas_score_medium:
        tags.append("芝麻信用分一般")
    elif zhimas_score_medium <= s < zhimas_score_good:
        tags.append("芝麻信用分良好")
    elif zhimas_score_good <= s < zhimas_score_very_good:
        tags.append("芝麻信用分优秀")
    else:
        tags.append("芝麻信用分极好")
    return tags



